<style>
    .easyui-accordion li {
        padding: 0px;
        /*margin-left: 10px;*/
        box-sizing: border-box;
        padding-left: 10px;
        width: 100%;
        border-bottom: 1px dotted royalblue;
        list-style: none;
        line-height: 28px;
        font-size: 105%;
        cursor: pointer;
    }
</style>
<div class="easyui-accordion" id="left-accordion" data-options="border:false"></div>
<script type="text/javascript">
    $.ajax({
        url: '/user/menu',
        dataType: 'json',
        cache: false,
        success: function(_json) {
            _json.map(function(menu) {
                if (menu.group == 'root') {
                    var htm = '<div style="padding:0">'
                    _json.map(function(_sub) {
                        if (_sub.group !== 'root' && _sub.uri.indexOf(menu.uri) === 0) {
                            htm += '<li class="menu_item" uri="' + _sub.uri + '">' + _sub.text + '</li>'
                        }
                    });
                    htm += '</div>';
                    $('#left-accordion').accordion('add', {
                        title: menu.text,
                        content: htm,
                        border: 'false'
                    });
                }
            });

            $('.menu_item').on('click', function(e) {
                var curr = $(this).attr('uri');
                _json.map(function(menu) {
                    if (menu.uri == curr) {
                        $.publish(MSG.LEFT_MENU_EVENT, JSON.stringify(menu));
                    }
                })

            });
        },
        error: function(xhr) {
            window.location.href = '/index.html';
        }
    });
</script>